/**
 *
 * Copyright (c) 2012 NCS Corporation.
 *
 * Author: tangb
 * Created Date: May 30, 2012
 * 
 * 	version					author					remark
 * 	1.0						tangb				
 */
package com.ocgs.base.util;

public class NumberUtil {
	public static String formatLong(Long longValue) {
		if (longValue == null)
			return "";
		return String.valueOf(longValue.longValue());
	}

	public static Long parseLong(String longStr) {
		if (longStr == null || longStr.trim().equalsIgnoreCase(""))
			return null;
		return new Long(longStr);
	}

	public static String formatDouble(Double doubleValue) {
		if (doubleValue == null)
			return "";
		return String.format("%.2f", doubleValue);
	}

	public static Double parseDouble(String doubleStr) {
		if (doubleStr == null || doubleStr.trim().equalsIgnoreCase(""))
			return null;
		return new Double(doubleStr);
	}
}
